let disp = require("../../../utils/broadcast");
var app = getApp();
let imgurl = app.globalData.imgurl;
let testAddr = app.globalData.testAddr;
Page({
	data: {
		username: {
			your: "",
		},
	},

	// options = 系统传入的 url 参数
	onLoad(options){
		let username = JSON.parse(options.username);
		this.setData({ 
      username: username
     });
    this.detail(username.your)
		
	},
  //  根据guestid查询详细信息
  detail: function (id) {
    var that = this
    var arr;
    app.util.request({
      url: testAddr + "/Guest/GetInfoByID?guestID=" + id,
      method: "POST",
      data: {},
      success: function (res) {
        arr = res.data
        wx.setNavigationBarTitle({
          title: arr.guestName
        });
      },
      fail: function (res) {

      },
      complete: function (res) {
        wx.hideLoading()
      },
    });
  },
	onUnload(){
		disp.fire("em.chatroom.leave");
	},

});
